// Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas Neshkov  Date: 22/03/2011 12:31:15 p.m.
// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   reportePackingList.java

package com.luxsoft.sw3.impap.reportes;

import com.jgoodies.forms.builder.DefaultFormBuilder;
import com.jgoodies.forms.layout.FormLayout;
import com.luxsoft.siipap.swing.actions.SWXAction;
import com.luxsoft.siipap.swing.controls.Header;
import com.luxsoft.siipap.swing.controls.SXAbstractDialog;
import com.luxsoft.siipap.swing.reports.ReportUtils;
import java.awt.BorderLayout;
import java.util.HashMap;
import java.util.Map;
import javax.swing.*;
import org.apache.log4j.Logger;

public class reportePackingList extends SWXAction
{
    public class ReportForm extends SXAbstractDialog
    {

        private void initComponents()
        {
            referencia = new JTextField(40);
        }

        private JComponent buildForm()
        {
            initComponents();
            FormLayout layout = new FormLayout("p,3dlu,f:60dlu:g", "");
            DefaultFormBuilder builder = new DefaultFormBuilder(layout);
            builder.append("Referencia", referencia);
            return builder.getPanel();
        }

        protected JComponent buildHeader()
        {
            return (new Header("PackingList", "")).getHeader();
        }

        protected JComponent buildContent()
        {
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(buildForm(), "Center");
            panel.add(buildButtonBarWithOKCancel(), "South");
            return panel;
        }

        public void doApply()
        {
            super.doApply();
            parametros.put("REFERENCIA", referencia.getText());
            logger.info((new StringBuilder("Parametros de reporte:")).append(parametros).toString());
        }

        public Map getParametros()
        {
            return parametros;
        }

        private final Map parametros = new HashMap();
        private JTextField referencia;
        

        public ReportForm()
        {            
            super("PackingList");
        }
    }


    public reportePackingList()
    {
    }

    protected void execute()
    {
        ReportForm form = new ReportForm();
        form.open();
        if(!form.hasBeenCanceled())
            ReportUtils.viewReport(ReportUtils.toReportesPath("compras/PackingList.jasper"), form.getParametros());
        form.dispose();
    }

    public static void run()
    {
        reportePackingList action = new reportePackingList();
        action.execute();
    }

    public static void main(String args[])
    {
        run();
    }
}
